<template>
    <div class="banner">
        <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
            <van-swipe-item v-for="item in banner" :key="item.id">
                <img :src="$pre+item.img" alt="">
            </van-swipe-item>
        </van-swipe>
    </div>
</template>

<script>
import {reqHomeBanner} from "../../../http/api"
export default {
    data () {
        return {
            banner:[],
        }
    },
    mounted () {
        reqHomeBanner().then((res)=>{
            // console.log(res);
            if(res.data.code == 200){
                this.banner = res.data.list
            }
        })
    }
}
</script>

<style scoped lang="less">
@import url(../../../less/index.less);
img {
  width: 100%;
  height: 100%;
}
.my-swipe{
  height: 3.8rem;
}
</style>